package com.sunkyc.framework.system.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sunkyc.framework.system.entity.SysRoleDept;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 角色和部门关联表 Mapper 接口
 * </p>
 *
 * @author sunkyc
 * @since 2022-05-31
 */
public interface SysRoleDeptMapper extends BaseMapper<SysRoleDept> {

    /**
     * 根据角色id获取部门编号的列表
     */
    @Select("select  dept_id from sys_role_dept where role_id = #{roleId}")
    List<Long> queryDeptIdsByRoleId(Long roleId);


}
